package com.etc.controller;

import com.etc.po.UserMast;
import com.etc.service.IUserMastService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Controller
public class UserMastController {

    // 动态代理注入
    @Autowired
    IUserMastService service;

    @RequestMapping("jsp/user/search.action")
    public String search(Model model) {
        // 调用service方法
        List<UserMast> userlist = service.findAll();
        model.addAttribute("userlist", userlist);
        return "user/usersearch";
    }

}
